package connexion;

import java.awt.Point;
import java.io.IOException;
import java.io.Serializable;


public class PlacementMessage implements Message,Serializable {

	public static final String SHOOTING_REASON = "shooting";

	public static final String PERCEPTION = "perception";
	String agent;
	Point pos;
	String reason;
	String team=null;
	public PlacementMessage(String s,String reason, Point pos2) {
		agent=s;
		pos=pos2;
		this.reason=reason;
	}
	public PlacementMessage(String agt,String team,String reason, Point pos) {
		agent=agt;
		this.pos=pos;
		this.reason=reason;
		this.team=team;
	}
	@Override
	
	public String agentConcerned() {
		// TODO Auto-generated method stub
		return agent;
	}
	
	public String toString()
	{
		return "placement : agent "+agent+":"+team+" "+pos+" for "+reason;
	}
	public String getAgent() {
		return agent;
	}
	public Point getPosition() {
		return pos;
	}
	
	 protected void writeObject(java.io.ObjectOutputStream out)
     throws IOException
     {
		 out.writeObject(agent);
		 out.writeObject(pos);
		 out.writeObject(reason);
     }
	 protected void readObject(java.io.ObjectInputStream in)
	 throws IOException, ClassNotFoundException{
		 agent=(String)in.readObject();
		 pos=(Point)in.readObject();
		 reason=(String)in.readObject();

	 }
	public String getReason() {
		return reason;
	}
	public String getTeam()
	{
		return team;
	}


}
